home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / CodeFragments.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  21KB  |  591 lines

  1. /*
  2.      File:        CodeFragments.h
  3.  
  4.      Contains:    Public Code Fragment Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7 and System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. /*
  19.  *
  20.  ===========================================================================================
  21.  The Code Fragment Manager API
  22.  =============================
  23. */
  24. #ifndef __CODEFRAGMENTS__
  25. #define __CODEFRAGMENTS__
  26.  
  27. #ifndef __TYPES__
  28. #include <Types.h>
  29. #endif
  30. #ifndef __FILES__
  31. #include <Files.h>
  32. #endif
  33. #if FOR_SYSTEM8_PREEMPTIVE
  34. #ifndef __KERNEL__
  35. #include <Kernel.h>
  36. #endif
  37. #ifndef __FILEMANAGERTYPES__
  38. #include <FileManagerTypes.h>
  39. #endif
  40. #ifndef __TEXTOBJECTS__
  41. #include <TextObjects.h>
  42. #endif
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. #if PRAGMA_IMPORT_SUPPORTED
  50. #pragma import on
  51. #endif
  52.  
  53. #if PRAGMA_ALIGN_SUPPORTED
  54. #pragma options align=mac68k
  55. #endif
  56.  
  57. /*
  58.  ß
  59.  ===========================================================================================
  60.  Universal types and constants
  61.  =============================
  62. */
  63. #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
  64. /*
  65.  ----------------------------------------------------------------------------
  66.  These declarations are for System 7 and all System 8 execution environments.
  67. */
  68.  
  69. enum {
  70.     kCFragResourceType            = 'cfrg',
  71.     kCFragResourceID            = 0,
  72.     kCFragLibraryFileType        = 'shlb',
  73.     kCFragAllFileTypes            = 0xFFFFFFFF
  74. };
  75.  
  76. typedef OSType CFragArchitecture;
  77.  
  78. enum {
  79.     kPowerPCCFragArch            = 'pwpc',
  80.     kMotorola68KCFragArch        = 'm68k',
  81.     kAnyCFragArch                = 0x3F3F3F3F
  82. };
  83.  
  84. #if GENERATINGPOWERPC
  85.  
  86. enum {
  87.     kCompiledCFragArch            = kPowerPCCFragArch
  88. };
  89.  
  90. #endif
  91. #if GENERATING68K
  92.  
  93. enum {
  94.     kCompiledCFragArch            = kMotorola68KCFragArch
  95. };
  96.  
  97. #endif
  98. typedef UInt32 CFragVersionNumber;
  99.  
  100. enum {
  101.     kNullCFragVersion            = 0,
  102.     kWildcardCFragVersion        = 0xFFFFFFFF
  103. };
  104.  
  105. typedef UInt8 CFragUsage;
  106.  
  107. enum {
  108.     kImportLibraryCFrag            = 0,                            /* Standard CFM import library.*/
  109.     kApplicationCFrag            = 1,                            /* Macintosh application.*/
  110.     kDropInAdditionCFrag        = 2                                /* Private extension to an application or library.*/
  111. };
  112.  
  113.  
  114. enum {
  115.     kIsCompleteCFrag            = 0,                            /* A "base" fragment, not an update.*/
  116.     kFirstCFragUpdate            = 1                                /* The first update, others are numbered 2, 3, ...*/
  117. };
  118.  
  119.  
  120. enum {
  121.     kCFragGoesToEOF                = 0
  122. };
  123.  
  124. typedef UInt8 CFragLocatorKind;
  125.  
  126. enum {
  127.     kMemoryCFragLocator            = 0,                            /* Container is already addressable.*/
  128.     kDataForkCFragLocator        = 1,                            /* Container is in a file's data fork.*/
  129.     kResourceCFragLocator        = 2                                /* Container is in a file's resource fork.*/
  130. };
  131.  
  132. /*
  133.  --------------------------------------------------------------------------------------
  134.  A 'cfrg' resource consists of a header followed by a sequence of variable length
  135.  members.  The constant kDefaultCFragNameLen only provides for a legal ANSI declaration
  136.  and for a reasonable display in a debugger.  The actual name field is cut to fit.
  137.  There may be "extensions" after the name, the memberSize field includes them.  The
  138.  general form of an extension is a 16 bit type code followed by a 16 bit size in bytes.
  139.  Only one standard extension type is defined at present, it is used by SOM's searching
  140.  mechanism.
  141. */
  142. union CFragUsage1Union {                                                                /* ! Meaning differs depending on value of "usage".*/
  143.     UInt32                             appStackSize;                /* If the fragment is an application. (Not used by CFM!)*/
  144. };
  145. typedef union CFragUsage1Union CFragUsage1Union;
  146.  
  147. union CFragUsage2Union {                                                                /* ! Meaning differs depending on value of "usage".*/
  148.     SInt16                             appSubdirID;                /* If the fragment is an application.*/
  149. };
  150. typedef union CFragUsage2Union CFragUsage2Union;
  151.  
  152. union CFragWhere1Union {                                                                /* ! Meaning differs depending on value of "where".*/
  153.     UInt32                             spaceID;                    /* If the fragment is in memory.  (Actually an AddressSpaceID.)*/
  154.     OSType                             forkKind;                    /* If the fragment is in an arbitrary byte stream fork.*/
  155. };
  156. typedef union CFragWhere1Union CFragWhere1Union;
  157.  
  158. union CFragWhere2Union {                                                                /* ! Meaning differs depending on value of "where".*/
  159.     UInt16                             forkInstance;                /* If the fragment is in an arbitrary byte stream fork.*/
  160. };
  161. typedef union CFragWhere2Union CFragWhere2Union;
  162.  
  163.  
  164. enum {
  165.     kDefaultCFragNameLen        = 16
  166. };
  167.  
  168. struct CFragResourceMember {
  169.     CFragArchitecture                 architecture;
  170.     UInt16                             reservedA;                    /* ! Must be zero!*/
  171.     UInt8                             reservedB;                    /* ! Must be zero!*/
  172.     UInt8                             updateLevel;
  173.     CFragVersionNumber                 currentVersion;
  174.     CFragVersionNumber                 oldDefVersion;
  175.     CFragUsage1Union                 uUsage1;
  176.     CFragUsage2Union                 uUsage2;
  177.     CFragUsage                         usage;
  178.     CFragLocatorKind                 where;
  179.     UInt32                             offset;
  180.     UInt32                             length;
  181.     CFragWhere1Union                 uWhere1;
  182.     CFragWhere2Union                 uWhere2;
  183.     UInt16                             extensionCount;                /* The number of extensions beyond the name.*/
  184.     UInt16                             memberSize;                    /* Size in bytes, includes all extensions.*/
  185.     unsigned char                     name[16];                    /* ! Actually a sized PString.*/
  186. };
  187. typedef struct CFragResourceMember CFragResourceMember;
  188.  
  189. typedef CFragResourceMember *CFragResourceMemberPtr;
  190. struct CFragResourceExtensionHeader {
  191.     UInt16                             extensionKind;
  192.     UInt16                             extensionSize;
  193. };
  194. typedef struct CFragResourceExtensionHeader CFragResourceExtensionHeader;
  195.  
  196. typedef CFragResourceExtensionHeader *CFragResourceExtensionHeaderPtr;
  197. struct CFragResourceSearchExtension {
  198.     CFragResourceExtensionHeader     header;
  199.     OSType                             libKind;
  200.     unsigned char                     qualifiers[1];                /* ! Actually four PStrings.*/
  201. };
  202. typedef struct CFragResourceSearchExtension CFragResourceSearchExtension;
  203.  
  204. typedef CFragResourceSearchExtension *CFragResourceSearchExtensionPtr;
  205.  
  206. enum {
  207.     kCFragResourceSearchExtensionKind = 0x30EE
  208. };
  209.  
  210. struct CFragResource {
  211.     UInt32                             reservedA;                    /* ! Must be zero!*/
  212.     UInt32                             reservedB;                    /* ! Must be zero!*/
  213.     UInt16                             reservedC;                    /* ! Must be zero!*/
  214.     UInt16                             version;
  215.     UInt32                             reservedD;                    /* ! Must be zero!*/
  216.     UInt32                             reservedE;                    /* ! Must be zero!*/
  217.     UInt32                             reservedF;                    /* ! Must be zero!*/
  218.     UInt32                             reservedG;                    /* ! Must be zero!*/
  219.     UInt16                             reservedH;                    /* ! Must be zero!*/
  220.     UInt16                             memberCount;
  221.     CFragResourceMember             firstMember;
  222. };
  223. typedef struct CFragResource CFragResource;
  224.  
  225. typedef CFragResource *CFragResourcePtr;
  226.  
  227. enum {
  228.     kCurrCFragResourceVersion    = 1
  229. };
  230.  
  231. #define AlignToFour(aValue)    (((aValue) + 3) & ~3)
  232. #define kBaseCFragResourceMemberSize    (offsetof ( CFragResourceMember, name ) )
  233. #define kBaseCFragResourceSize            (offsetof ( CFragResource, firstMember.name ) )
  234. #define NextCFragResourceMemberPtr(aMemberPtr)    \
  235.         ((CFragResourceMemberPtr) ((BytePtr)aMemberPtr + aMemberPtr->memberSize))
  236. #define FirstCFragResourceExtensionPtr(aMemberPtr)                                            \
  237.         ((CFragResourceExtensionHeaderPtr) ((BytePtr)aMemberPtr +                            \
  238.                                             AlignToFour ( kBaseCFragResourceMemberSize +    \
  239.                                                           aMemberPtr->name[0] + 1 ) ))
  240. #define NextCFragResourceExtensionPtr(anExtensionPtr)                    \
  241.         ((CFragResourceExtensionHeaderPtr) ((BytePtr)anExtensionPtr +    \
  242.                                             ((CFragResourceExtensionHeaderPtr)anExtensionPtr)->extensionSize ))
  243. #define FirstCFragResourceSearchQualifier(searchExtensionPtr)                    \
  244.         ((StringPtr) ((BytePtr)searchExtensionPtr +                                \
  245.                       offsetof ( CFragResourceSearchExtension, qualifiers ) ))
  246. #define NextCFragResourceSearchQualifier(searchQualifierPtr)    \
  247.         ((StringPtr) ((BytePtr)searchQualifierPtr +    searchQualifierPtr[0] + 1))
  248. typedef struct OpaqueCFragConnectionID* CFragConnectionID;
  249. typedef struct OpaqueCFragClosureID* CFragClosureID;
  250. typedef struct OpaqueCFragContainerID* CFragContainerID;
  251. typedef struct OpaqueCFragContextID* CFragContextID;
  252. typedef UInt32 CFragLoadOptions;
  253.  
  254. enum {
  255.     kLoadCFrag                    = 0x0001,                        /* Try to use existing copy, load if not found.*/
  256.     kFindCFrag                    = 0x0002,                        /* Try find an existing copy, don't load if not found.*/
  257.     kPrivateCFragCopy            = kLoadCFrag | 0x0004            /* Load a new private copy.*/
  258. };
  259.  
  260.  
  261. enum {
  262.     kUnresolvedCFragSymbolAddress = 0
  263. };
  264.  
  265. typedef UInt8 CFragSymbolClass;
  266.  
  267. enum {
  268.     kCodeCFragSymbol            = 0,
  269.     kDataCFragSymbol            = 1,
  270.     kTVectorCFragSymbol            = 2,
  271.     kTOCCFragSymbol                = 3,
  272.     kGlueCFragSymbol            = 4
  273. };
  274.  
  275. #endif
  276. /*
  277.  ß
  278.  ===========================================================================================
  279.  System 7 Services (Deprecated in System 8)
  280.  ==========================================
  281. */
  282. #if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
  283. /*
  284.  ---------------------------------------------------------------------------------
  285.  These declarations are for System 7 and the System 8 cooperative environment, but
  286.  should be avoided under System 8.  Better alternatives exist for System 8.
  287. */
  288. #define IsFileLocation(where)    \
  289.         ( ((where) == kDataForkCFragLocator) || ((where) == kResourceCFragLocator) )
  290. extern pascal OSErr GetSharedLibrary(ConstStr63Param libName, CFragArchitecture archType, CFragLoadOptions loadFlags, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
  291.  THREEWORDINLINE(0x3F3C, 0x0001, 0xAA5A);
  292.  
  293. extern pascal OSErr GetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
  294.  THREEWORDINLINE(0x3F3C, 0x0002, 0xAA5A);
  295.  
  296. extern pascal OSErr GetMemFragment(void *memAddr, UInt32 length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
  297.  THREEWORDINLINE(0x3F3C, 0x0003, 0xAA5A);
  298.  
  299. extern pascal OSErr CloseConnection(CFragConnectionID *connID)
  300.  THREEWORDINLINE(0x3F3C, 0x0004, 0xAA5A);
  301.  
  302. extern pascal OSErr FindSymbol(CFragConnectionID connID, ConstStr255Param symName, Ptr *symAddr, CFragSymbolClass *symClass)
  303.  THREEWORDINLINE(0x3F3C, 0x0005, 0xAA5A);
  304.  
  305. extern pascal OSErr CountSymbols(CFragConnectionID connID, long *symCount)
  306.  THREEWORDINLINE(0x3F3C, 0x0006, 0xAA5A);
  307.  
  308. extern pascal OSErr GetIndSymbol(CFragConnectionID connID, long symIndex, Str255 symName, Ptr *symAddr, CFragSymbolClass *symClass)
  309.  THREEWORDINLINE(0x3F3C, 0x0007, 0xAA5A);
  310.  
  311. #endif
  312. /*
  313.  ß
  314.  ===========================================================================================
  315.  System 8 Services (Not available in System 7)
  316.  =============================================
  317. */
  318. #if FOR_SYSTEM8_PREEMPTIVE
  319. /*
  320.  ---------------------------------------------------------------------------------
  321.  These declarations are for all System 8 execution environments, but not System 7.
  322. */
  323.  
  324. enum {
  325.     kPatchCFragUpdateLevel        = 255
  326. };
  327.  
  328.  
  329. enum {
  330.     kByteStreamCFragLocator        = 3,
  331.     kNamedFragmentCFragLocator    = 4
  332. };
  333.  
  334.  
  335. enum {
  336.     kNamedLibraryCFragLocator    = kNamedFragmentCFragLocator    /* !!! Remove in D12!*/
  337. };
  338.  
  339.  
  340. enum {
  341.     kPrivilegedCFragMask        = 0x0010,                        /* ! May be removed in the future!*/
  342.     kResidentCFragMask            = 0x0020,                        /* ! May be removed in the future!*/
  343.     kTreatCFragAsLibraryMask    = 0x0040                        /* Used in GetXyzFragment to recognize by name too.*/
  344. };
  345.  
  346.  
  347. enum {
  348.     kPrivilegedCFragFlag        = kPrivilegedCFragMask,            /* !!! Remove in D12!*/
  349.     kResidentCFragFlag            = kResidentCFragMask            /* !!! Remove in D12!*/
  350. };
  351.  
  352.  
  353. enum {
  354.     kMainCFragSymbolIndex        = -1,
  355.     kInitCFragSymbolIndex        = -2,
  356.     kTermCFragSymbolIndex        = -3
  357. };
  358.  
  359. struct CFragRegisteredFileInfo {
  360.     FSObjectRef                     fileRef;
  361.     OSType                             fileType;
  362.     ItemCount                         nestingDepth;
  363. };
  364. typedef struct CFragRegisteredFileInfo CFragRegisteredFileInfo;
  365.  
  366.  
  367. enum {
  368.     kCFragRegisteredFileInfoVersion = 0x00010001
  369. };
  370.  
  371. typedef UInt8 CFragCompatibility;
  372.  
  373. enum {
  374.     CFragBothCompatible            = 0,
  375.     CFragClientTooOld            = 1,
  376.     CFragProviderTooOld            = 2
  377. };
  378.  
  379. typedef UInt32 CFragShortVersionPair;
  380. #define ComposeCFragShortVersionPair(current,older)    (current << 16 | older)
  381. #define GetCFragShortVersionCurrent(version)        (version >> 16)
  382. #define GetCFragShortVersionOlder(version)            (version & 0xFFFF)
  383. extern CFragCompatibility CFragCheckCompatibility(UInt32 clientPreferredVersion, UInt32 clientOldImpVersion, UInt32 providerCurrentVersion, UInt32 providerOldDefVersion);
  384.  
  385. extern CFragCompatibility CFragCheckShortCompatibility(UInt32 clientVersions, UInt32 providerVersions);
  386.  
  387. extern Boolean CFragHasFileLocation(CFragLocatorKind where);
  388.  
  389. extern Boolean CFragHasUnresolvedImports(CFragConnectionID connID);
  390.  
  391. extern OSStatus CFragPrepareNamedFragment(ConstStr63Param fragName, CFragUsage usage, CFragArchitecture archType, CFragVersionNumber preferredVersion, CFragVersionNumber oldestVersion, CFragLoadOptions loadFlags, CFragConnectionID *connID, LogicalAddress *mainAddr, TextObject optErrMsg);
  392.  
  393. extern OSStatus CFragPrepareFromDiskFork(FSObjectRef fileSpec, FSForkType forkTag, ItemCount forkInstance, ByteCount offset, ByteCount length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, LogicalAddress *mainAddr, TextObject optErrMsg);
  394.  
  395. extern OSStatus CFragPrepareFromMemory(LogicalAddress fragAddr, ByteCount length, ConstStr63Param fragName, CFragLoadOptions loadFlags, CFragConnectionID *connID, LogicalAddress *mainAddr, TextObject optErrMsg);
  396.  
  397. extern OSStatus CFragCloseConnection(CFragConnectionID *connID);
  398.  
  399. extern OSStatus CFragFindNamedSymbol(CFragConnectionID connID, ConstStr255Param symName, LogicalAddress *symAddr, CFragSymbolClass *symClass);
  400.  
  401. extern OSStatus CFragCountSymbols(CFragConnectionID connID, ItemCount *symCount);
  402.  
  403. extern OSStatus CFragGetIndexedSymbol(CFragConnectionID connID, SInt32 symIndex, Str255 symName, LogicalAddress *symAddr, CFragSymbolClass *symClass);
  404.  
  405. extern OSStatus CFragGetFileSpec(CFragConnectionID connectionID, FSObjectRef *fileSpec);
  406.  
  407. extern OSStatus CFragGetFragmentName(CFragConnectionID connectionID, Str63 name);
  408.  
  409. extern OSStatus CFragRegisterFileFragments(KernelProcessID processID, FSObjectRef fileSpec, OSType fileType, ItemCount nestingDepth);
  410.  
  411. extern OSStatus CFragUnregisterFileFragments(KernelProcessID processID, FSObjectRef fileSpec, OSType fileType, ItemCount nestingDepth);
  412.  
  413. extern OSStatus CFragGetRegisteredFiles(KernelProcessID processID, ItemCount requestedCount, ItemCount *totalCount, PBVersion infoVersion, CFragRegisteredFileInfo *registeredFiles);
  414.  
  415. #endif
  416. /*
  417.  ß
  418.  ===========================================================================================
  419.  Initialization & Termination Routines
  420.  =====================================
  421.  -----------------------------------------------------------------------------------------
  422.  A fragment's initialization and termination routines are called when a new incarnation of
  423.  the fragment is created or destroyed, respectively.  Exactly when this occurs depends on
  424.  what kinds of section sharing the fragment has and how the fragment is prepared.  Import
  425.  libraries have at most one incarnation per process.  Fragments prepared with option
  426.  kPrivateCFragCopy may have many incarnations per process.
  427.  The initialization function is passed a pointer to an initialization information structure
  428.  and returns an OSErr.  If an initialization function returns a non-zero value the entire
  429.  closure of which it is a part fails.  The CFragInitBlock type has different visible parts
  430.  under System 7 and System 8, but is of course the same internally.  The C prototype for an
  431.  initialization function is:
  432.         pascal OSErr    CFragInitFunction    ( const CFragInitBlock *    initBlock );
  433.  The termination procedure takes no parameters and returns nothing.  The C prototype for a
  434.  termination procedure is:
  435.         pascal void        CFragTermProcedure    ( void );
  436. */
  437. #if FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
  438. /*
  439.  --------------------------------------------------------------------------------------
  440.  These declarations are the preferred form for System 8, hiding implementation details.
  441. */
  442. struct CFragOpaqueInitBlock {
  443.     KernelProcessID                 processID;
  444.     CFragClosureID                     closureID;
  445.     CFragConnectionID                 connectionID;
  446.     UInt32                             reservedA[8];
  447. };
  448. typedef struct CFragOpaqueInitBlock CFragOpaqueInitBlock;
  449.  
  450. typedef CFragOpaqueInitBlock *CFragOpaqueInitBlockPtr;
  451. typedef CFragOpaqueInitBlock CFragInitBlock;
  452. typedef CFragOpaqueInitBlockPtr CFragInitBlockPtr;
  453. #else
  454. /*
  455.  --------------------------------------------------------------------------------------
  456.  These declarations are for System 7.  They may be used in System 8 but expose details.
  457. */
  458. struct CFragSystem7MemoryLocator {
  459.     LogicalAddress                     address;
  460.     UInt32                             length;
  461.     Boolean                         inPlace;
  462.     UInt8                             reservedA;                    /* ! Must be zero!*/
  463.     UInt16                             reservedB;                    /* ! Must be zero!*/
  464. };
  465. typedef struct CFragSystem7MemoryLocator CFragSystem7MemoryLocator;
  466.  
  467. struct CFragSystem7DiskFlatLocator {
  468.     FSSpecPtr                         fileSpec;
  469.     UInt32                             offset;
  470.     UInt32                             length;
  471. };
  472. typedef struct CFragSystem7DiskFlatLocator CFragSystem7DiskFlatLocator;
  473.  
  474. /* ! This must have a file specification at the same offset as a disk flat locator!*/
  475. struct CFragSystem7SegmentedLocator {
  476.     FSSpecPtr                         fileSpec;
  477.     OSType                             rsrcType;
  478.     SInt16                             rsrcID;
  479.     UInt16                             reservedA;                    /* ! Must be zero!*/
  480. };
  481. typedef struct CFragSystem7SegmentedLocator CFragSystem7SegmentedLocator;
  482.  
  483. struct CFragSystem7Locator {
  484.     SInt32                             where;
  485.     union {
  486.         CFragSystem7DiskFlatLocator     onDisk;
  487.         CFragSystem7MemoryLocator         inMem;
  488.         CFragSystem7SegmentedLocator     inSegs;
  489.     }                                 u;
  490. };
  491. typedef struct CFragSystem7Locator CFragSystem7Locator;
  492.  
  493. typedef CFragSystem7Locator *CFragSystem7LocatorPtr;
  494. struct CFragSystem7InitBlock {
  495.     CFragContextID                     contextID;
  496.     CFragClosureID                     closureID;
  497.     CFragConnectionID                 connectionID;
  498.     CFragSystem7Locator             fragLocator;
  499.     StringPtr                         libName;
  500.     UInt32                             reservedA;                    /* ! Must be zero!*/
  501. };
  502. typedef struct CFragSystem7InitBlock CFragSystem7InitBlock;
  503.  
  504. typedef CFragSystem7InitBlock *CFragSystem7InitBlockPtr;
  505. typedef CFragSystem7InitBlock CFragInitBlock;
  506. typedef CFragSystem7InitBlockPtr CFragInitBlockPtr;
  507. #endif
  508. typedef OSErr (*CFragInitFunction)(const CFragInitBlock *initBlock);
  509. typedef void (*CFragTermProcedure)(void );
  510. /*
  511.  ß
  512.  ===========================================================================================
  513.  Old Name Spellings
  514.  ==================
  515.  -------------------------------------------------------------------------------------------
  516.  We've tried to reduce the risk of name collisions in the future by introducing the phrase
  517.  "CFrag" into constant and type names.  The old names are defined below in terms of the new.
  518. */
  519. #if OLDROUTINENAMES
  520. typedef CFragConnectionID ConnectionID;
  521. typedef CFragLoadOptions LoadFlags;
  522. typedef CFragSymbolClass SymClass;
  523. typedef CFragInitBlock InitBlock;
  524. typedef CFragInitBlockPtr InitBlockPtr;
  525. #if !FOR_OPAQUE_SYSTEM_DATA_STRUCTURES
  526. typedef CFragSystem7MemoryLocator MemFragment;
  527. typedef CFragSystem7DiskFlatLocator DiskFragment;
  528. typedef CFragSystem7SegmentedLocator SegmentedFragment;
  529. typedef CFragSystem7Locator FragmentLocator;
  530. typedef CFragSystem7LocatorPtr FragmentLocatorPtr;
  531. typedef CFragSystem7MemoryLocator CFragHFSMemoryLocator;
  532. typedef CFragSystem7DiskFlatLocator CFragHFSDiskFlatLocator;
  533. typedef CFragSystem7SegmentedLocator CFragHFSSegmentedLocator;
  534. typedef CFragSystem7Locator CFragHFSLocator;
  535. typedef CFragSystem7LocatorPtr CFragHFSLocatorPtr;
  536. #endif
  537.  
  538. enum {
  539.     kPowerPCArch                = kPowerPCCFragArch,
  540.     kMotorola68KArch            = kMotorola68KCFragArch,
  541.     kAnyArchType                = kAnyCFragArch,
  542.     kNoLibName                    = 0,
  543.     kNoConnectionID                = 0,
  544.     kLoadLib                    = kLoadCFrag,
  545.     kFindLib                    = kFindCFrag,
  546.     kNewCFragCopy                = kPrivateCFragCopy,
  547.     kLoadNewCopy                = kPrivateCFragCopy,
  548.     kUseInPlace                    = 0x80,
  549.     kCodeSym                    = kCodeCFragSymbol,
  550.     kDataSym                    = kDataCFragSymbol,
  551.     kTVectSym                    = kTVectorCFragSymbol,
  552.     kTOCSym                        = kTOCCFragSymbol,
  553.     kGlueSym                    = kGlueCFragSymbol,
  554.     kInMem                        = kMemoryCFragLocator,
  555.     kOnDiskFlat                    = kDataForkCFragLocator,
  556.     kOnDiskSegmented            = kResourceCFragLocator,
  557.     kIsLib                        = kImportLibraryCFrag,
  558.     kIsApp                        = kApplicationCFrag,
  559.     kIsDropIn                    = kDropInAdditionCFrag,
  560.     kFullLib                    = kIsCompleteCFrag,
  561.     kUpdateLib                    = kFirstCFragUpdate,
  562.     kWholeFork                    = kCFragGoesToEOF,
  563.     kCFMRsrcType                = kCFragResourceType,
  564.     kCFMRsrcID                    = kCFragResourceID,
  565.     kSHLBFileType                = kCFragLibraryFileType,
  566.     kUnresolvedSymbolAddress    = kUnresolvedCFragSymbolAddress
  567. };
  568.  
  569.  
  570. enum {
  571.     kPowerPC                    = kPowerPCCFragArch,
  572.     kMotorola68K                = kMotorola68KCFragArch
  573. };
  574.  
  575. #endif
  576.  
  577. #if PRAGMA_ALIGN_SUPPORTED
  578. #pragma options align=reset
  579. #endif
  580.  
  581. #if PRAGMA_IMPORT_SUPPORTED
  582. #pragma import off
  583. #endif
  584.  
  585. #ifdef __cplusplus
  586. }
  587. #endif
  588.  
  589. #endif /* __CODEFRAGMENTS__ */
  590.  
  591.